

cap log close

/* define global parameters and paths */

/* paths */
global basepath "M:\Massachusetts"      

global raw "$basepath\data_raw" 
global data_setup "$basepath\data_setup" 
global do_setup "$data_setup\programs"       
global data_clean "$basepath\data_clean" 
global log "$basepath\log" 
global saves "$raw\saves"
global lotto "$basepath\data_lotteries"

cd "$data_setup"

set seed 123456

/* Create a log file */
local c_date = c(current_date)
local cdate = subinstr("`c_date'", " ", "_", .)
log using "$log\logfile_`cdate'.log", replace text


/* install any packages locally */
sysdir set PERSONAL "$basepath/ado/personal"
sysdir set PLUS 	"$basepath/ado/plus"
sysdir set SITE     "$basepath/ado/site"

*user written commands necessary to run these programs
cap ssc install ivreg2
cap ssc install ranktest
cap ssc install reclink
cap ssc install center
cap ssc install unique
cap ssc install jarowinkler

/* keep this line in the config file */
/* It will provide some info about how and when the program was run */
/* See https://www.stata.com/manuals13/pcreturn.pdf#pcreturn */
di "=== SYSTEM DIAGNOSTICS ==="
di "Stata version: `c(stata_version)'"
di "Updated as of: `c(born_date)'"
di "Flavor:        `c(flavor)'"
di "Processors:    `c(processors)'"
di "OS:            `c(os)' `c(osdtl)'"
di "Machine type:  `c(machine_type)'"
di "=========================="



***BELOW ARE DATA SETUP FILES COMMON AMONG ALL CHARTER PROJECTS***
*Basic processing of the state SIMS data
do "$do_setup/1.1_sims.do" //rerun 12/22/2024
*some additional sims vars
do "$do_setup/1.1.1_sims_additionalvars.do" //rerun 12/22/2024

*Basic processing of the state MCAS data
do "$do_setup/1.2_mcas.do" //rerun 12/22/2024

*Basic processing of the NSC data
do "$do_setup/1.3_nsc.do" ///rerun 1/7/2023

*Basic AP process
do "$do_setup/1.4_ap.do" //rerun 12/23/2024

*Basic SAT process
do "$do_setup/1.5_sat.do" //rerun 12/23/2024

*Lotteries
do "$do_setup/1.6_lottery.do" //rerun 12/23/2024
*Lotteries -- those with parent address data
do "$do_setup/1.6_lottery_parentfilesonly.do" //rerun 12/23/2024 
*Suspensions
do "$do_setup/1.7_sims_susp.do" //rerun 12/23/2024
do "$do_setup/1.7_ssdr.do" //rerun 12/23/2024
do "$do_setup/1.7.1_combine_susp.do" //rerun 12/23/2024

*HS Graduation
do "$do_setup/1.8_hsgrad.do"  //rerun 12/23/2024

*College characteristics from IPEDS and Chetty
do "$do_setup/1.9_collegechars.do"  //rerun 12/23/2024

*VOCAL
do "$do_setup/1.10_vocal.do"  //rerun 12/23/2024

*State file (basic setup for non-lotto file)
*must rerun if anything above is updated
do "$do_setup/1.11_clean_state.do"   //rerun 12/23/2024

*IPEDS
do "$do_setup/1.12_ipeds.do"  //rerun 12/23/2024

*SCS
do "$do_setup/1.13_scs.do"

